import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'api/wareBuyReturn/addOrSave',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/wareBuyReturn/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/wareBuyReturn/addOrSave',
    method: 'post',
    data
  })
}

export function copy(data) {
  return request({
    url: 'api/wareBuyReturn/copy',
    method: 'post',
    data
  })
}

export function exportDe(data) {
  return request({
    url: 'api/wareBuyReturn/export',
    method: 'post',
    data
  })
}

export function importDe(data) {
  return request({
    url: 'api/wareBuyReturn/import',
    method: 'post',
    data
  })
}

export function passOrReject(data) {
  const obj = {
    url: 'api/wareBuyReturn/passOrReject',
    method: 'post',
    data
  }
  return request(obj)
}
export function enableOrDisable(data) {
  const obj = {
    url: 'api/wareBuyReturn/passOrReject',
    method: 'post',
    data
  }
  return request(obj)
}

export function removeDetail(data) {
  const obj = {
    url: 'api/wareBuyReturn/removeDetail',
    method: 'post',
    data
  }
  return request(obj)
}
export function detail(params) {
  const obj = {
    url: 'api/wareBuyReturn/detail',
    method: 'get',
    params
  }
  return request(obj)
}
export function exportDetail(data) {
  return request({
    url: 'api/wareBuyReturn/exportDetail',
    method: 'get',
    data
  })
}

export function print(data) {
  const obj = {
    url: 'api/wareBuyReturn/print',
    method: 'post',
    responseType: 'blob',
    data
  }
  return request(obj)
}
export function getWareBuyReturnPreviousNextPageIdList(data) {
  const obj = {
    url: '/api/wareBuyReturn/getWareBuyReturnPreviousNextPageIdList',
    method: 'get',
    params: data
  }
  return request(obj)
}

export default { add, edit, copy, exportDe, importDe, del, passOrReject, exportDetail, detail, removeDetail, enableOrDisable, print }
